<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<c:set var="contextPath" value="<%=request.getContextPath()%>"></c:set>
<c:forEach var="subComment" varStatus="vs" items="${subComments}">
<div class="comment_entry">
   		
   		<div class="entry_left">
   		<div style="clear: both;"></div>
   			<div class="user_icon">
          		 <a href="#" onclick="return false;" target="_blank"><img src="${contextPath}${subComment.createByUser.headPhoto.thumbnailMini}" alt="" title=""></a>
          		
      		</div>
      		 <a href="${contextPath }/viewCustomerInfo?customer.id=${subComment.createByUser.id}" title="${subComment.createByUser.userName}" target="_blank">${subComment.createByUser.userName}</a>
   		</div>
   		<div class="entry_right">
   		  
				<div class="comment_all">
					 <c:if test="${not empty subComment.album.photos}">
            	 	<div class="ppy3" style="margin-left: 20px;" >
								<ul class="ppy-imglist">
									<c:forEach items="${subComment.album.photos}" var="photo">
										<li>
							                  <a href="${contextPath}${photo.thumbnailLarge}">
							                      <img src="${contextPath}${photo.thumbnailSmall}" alt="">
							                  </a>
							                  <c:if test="${not empty photo.description}">
							                  	<span class="ppy-extcaption">
							                      <strong>${photo.description}</strong>
							                  	</span>
							                  </c:if>
							                  
							              </li>
									</c:forEach>
							              
							      </ul>
							        <div class="ppy-outer">
							                <div style="background-image: url(&quot;${contextPath}${subComment.album.coverPhoto.thumbnailSmall}&quot;);" class="ppy-stage">
							                    <div class="ppy-counter">
							                        <strong class="ppy-current">1</strong> / <strong class="ppy-total">9</strong> 
							                    </div>
							               	</div>
							                <div class="ppy-nav">
							                        <a class="ppy-next" title="下一张">下一张</a>
							                        <a class="ppy-prev" title="上一张">上一张</a>
							                </div>
							       </div>
							       <div style="visibility: hidden; height: 0px; overflow: hidden;" class="ppy-caption">
							                <span class="ppy-text">
							                       
							                </span>
							       </div>
						</div>
            	   </c:if>
            	   <c:choose>
            	 	<c:when test="${empty subComment.parentComment && subComment.parentCommentId != 0}">
            	 		<div class="feederback_outer">
            	 			 <div class="feedback_deleted" >
								<span class="entry-content">引用信息已被删除</span>
							</div>
			                   
		                </div>
            	 	</c:when>
            	 	<c:otherwise>
            	 		<c:if test="${subComment.parentCommentId != comment.id && subComment.parentCommentId != 0}">
		                     <div class="reference_conment" >
							<div class="user_info">
								<div class="info_left entry-meta">
									<a href="${contextPath }/viewCustomerInfo?customer.id=${subComment.parentComment.createByUserId}" title="${subComment.parentComment.createByUser.userName}" target="_blank">${subComment.parentComment.createByUser.userName}</a>
									<span>
										<jsp:include page="../common/timeFormat.jsp">
											<jsp:param value="${subComment.parentComment.createTime.time}" name="time"/>
											<jsp:param value="${subComment.parentComment.createTime.year }" name="year"/>
											<jsp:param value="${subComment.parentComment.createTime.month }" name="month"/>
											<jsp:param value="${subComment.parentComment.createTime.day}" name="day"/>
											<jsp:param value="${subComment.parentComment.createTime.hours}" name="hours"/>
											<jsp:param value="${subComment.parentComment.createTime.minutes}" name="minutes"/>
											<jsp:param value="${subComment.parentComment.createTime.date}" name="date"/>
										</jsp:include>
									</span>
								</div>
								<div class="info_right ">
		                      	  		<a onclick="scoreComment('${subComment.parentComment.id}', 1)">支持<span id="goodComm${subComment.parentComment.id}">(${subComment.parentComment.goodNum})</span></a><a onclick="scoreComment('${subComment.parentComment.id}', 2)">反对<span id="badComm${subComment.parentComment.id}">(${subComment.parentComment.badNum})</span></a><a href="${contextPath}/viewDiscussDetails?comment.id=${subComment.parentComment.id}">回应(${subComment.parentComment.subCommNum})</a>
		                       	</div> 
							</div>
							<div style="width: 95%" class="entry-content">${subComment.parentComment.brief}</div> 
						  </div> 
		            </c:if>
		            	  
            	 	</c:otherwise>
           		</c:choose>
	               <div class="comment_details">
	                ${subComment.content}
	               </div>
	               		<c:if test="${subComment.subCommNum != 0}">
	               			<div class="feedBack" >
	               				<div class="feedback_header">回应</div>
	               			<c:forEach items="${subComment.summarySubComments}" var="summaryFeedback" varStatus="vs">
	               				<c:choose>
	               					<c:when test="${vs.count < subComment.subCommNum}">
	               						<c:set value="border-bottom: 1px dashed #CCC;" var="border_style"></c:set>
	               					</c:when>
	               					<c:otherwise>
	               						<c:set value="" var="border_style"></c:set>
	               					</c:otherwise>
	               				</c:choose>
	               			
	               				<div class="feedBack_item" style="${border_style};"  onmouseover="showFeedBackTailsInfo(${summaryFeedback.id});" onmouseout="hideFeedBackTailsInfo(${summaryFeedback.id})">
	               					 <div class="feedback_user_icon">
		          						  <a href="#" onclick="return false;" target="_blank"><img src="${contextPath}${summaryFeedback.createByUser.headPhoto.thumbnailMiniS}" alt="" title=""></a>
		          				   </div>
	               					<div class="feedback_details" style="width: 70%"><a>${ summaryFeedback.createByUser.userName}:</a>${summaryFeedback.brief}</div> 
	               					<div id="feedback_tails${summaryFeedback.id}" class="feedback_tails">
	               						<a href="${contextPath}/viewDiscussDetails?comment.id=${summaryFeedback.id}">回应(${summaryFeedback.subCommNum})</a>
	               					</div>
	               				</div>
	               			</c:forEach>
	               				<c:if test="${subComment.subCommNum > 5}">
	               				<div class="feedBack_item" style="text-align:center" >
	               					<a href="${contextPath}/viewDiscussDetails?comment.id=${subComment.id}">查看全部回复</a>
	               				</div>
	               			</c:if>
	               		</div>
	               		</c:if>
	             	<div id="comm${subComment.id}" class="reply_area" >
        		
		            <div class="reply_user_icon">
		            <a href="#" onclick="return false;" target="_blank"><img src="${contextPath}${user.headPhoto.thumbnailMiniS}" alt="" title=""></a>
		             </div>
		             	<form action="${contextPath}/saveSubComment" method="post">
		             		
			                <div class="area_input_form"" >
			                			
			                    <div id="formContent${subComment.id}">
			                    	<div id="formContent${subComment.id}1" class="word_surplus sign-text"></div>
			                    	<textarea id="reply${subComment.id}" name="comment.content" style="height:63px;width:400px;"></textarea>
			                    	<input  type="hidden" name="article.id" value="${comment.article.id}">
			                    	<input type="hidden" name="parentComment.id" value="${subComment.id}"  />
			                    	<input type="hidden" name="superComment.id" value="${comment.id}"  />
			                    	<input type="hidden" name="subProperty" value="30"  />
			                    </div>
			                    
	                            <div class="replay_btn"  >
	                            	<button onclick="replyComment(this.form)" type="button" class="btn btn-info"  >回 应</button>
	                            </div>
			                </div>
		               </form>
		            </div>
	            </div>	
	            
	            
		          <div style="clear: both"></div>
		          <div class="tails_info" >
	             	<div class="info_left entry-meta" >
	                    <span>
	                    			<jsp:include page="../common/timeFormat.jsp">
									<jsp:param value="${subComment.createTime.time}" name="time"/>
									<jsp:param value="${subComment.createTime.year }" name="year"/>
									<jsp:param value="${subComment.createTime.month }" name="month"/>
									<jsp:param value="${subComment.createTime.day}" name="day"/>
									<jsp:param value="${subComment.createTime.hours}" name="hours"/>
									<jsp:param value="${subComment.createTime.minutes}" name="minutes"/>
									<jsp:param value="${subComment.createTime.date}" name="date"/>
								</jsp:include>
	                    		
	                    
	                    </span>
	                  	<c:set var="isAdmin" value="no"></c:set>
							<c:choose>
								<c:when test="${user.role.name eq 'admin'}">
									<c:set var="isAdmin" value="yes"></c:set>
								</c:when>
							</c:choose>
							<c:if test="${ isAdmin eq 'yes' || user.id == article.createByUserId}">
								<a href="${contextPath}/deleteComment?comment.id=${subComment.id}&article.id=${subComment.article.id}&parentComment.id=${comment.id}" >删除</a>
							</c:if>
							<a onclick="scoreComment('${subComment.id}', 1)">支持<span id="goodComm${subComment.id}">(${subComment.goodNum})</span></a><a onclick="scoreComment('${subComment.id}', 2)">反对<span id="badComm${subComment.id}">(${subComment.badNum})</span></a><a onclick="switchReply('comm${subComment.id}','${user.userName}', '${contextPath}/viewLogin')">回应(${subComment.subCommNum})</a><a target="_blank" href="${contextPath}/viewDiscussDetails?comment.id=${subComment.id}">详细</a>
							
	             	</div>
	             	
	            </div>
	         </div>
	     	
           
           <div style="clear: both"></div>
           
	         
 </div>
</c:forEach>